package com.wyk.demo.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wyk.demo.dao.EmpDao;
import com.wyk.demo.entity.Emp;
import com.wyk.demo.service.EmpService;
import com.wyk.demo.vo.Result;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EmpServiceImpl extends ServiceImpl<EmpDao,Emp> implements EmpService {
    @Autowired(required = false)
    private EmpDao empDao;

    @Override
    public Result<IPage<Emp>> listByPage(Integer currentPage, Integer pageSize) {
        Page<Emp> page=new Page<>(currentPage,pageSize);
        IPage<Emp> empIPage = empDao.queryTest(page, null);
        return new Result<>(200,"查询成功",empIPage);
    }
}
